<template>
  <div>
    <div>
      <van-nav-bar
        title="城市列表"
        left-arrow
        @click-left="onClickLeft"
        fixed
      />
    </div>
    <list :nowCity="nowCity"></list>
  </div>
</template>

<script>
import { Toast } from 'vant'
import list from './CityList.vue'

export default {
  components: { list },
  data () {
    return {
      nowCity: ''
    }
  },
  // 将城市数据传过来
  created () {
    this.nowCity = localStorage.getItem('city')
  },
  methods: {
    onClickLeft () {
      Toast('返回')
      this.$router.replace({
        path: '/layout/search'
      })
    }
  }
}
</script>

<style>
.van-nav-bar {
  height: 1.1rem;
}
.van-nav-bar__content{
  /* position: fixed; */
  z-index: 1;
}
</style>
